<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>

  <div id="app">
    <!-- 1. 对象语法 -->
    <!-- 字符串解析 '40px' -->
    <div :style="{fontSize: '40px'}">{{ message }}</div>
    <!-- 变量解析 size、color -->
    <div :style="{fontSize: size, backgroundColor: color}">{{ message }}</div>

    <!-- 2. 数组语法 -->
    <!-- 数组内放对象... -->
    <div :style="[{fontSize: size}, {backgroundColor: color}, {marginTop: '20px'}]">牛批</div>
  </div>

  <script src="../../js/vue.js"></script>
  <script>
    const app = new Vue({
      el: '#app',
      data: {
        message: 'hello',
        size: '60px',
        color: 'pink'
      }
    })
  </script>
</body>

</html>